
#include "mainwindow.h"

#include <QApplication>
#include <QDebug>
#include <QFileInfo>
#include <QMainWindow>
#include <QScreen>

#include "version.h"
#include "screenutil.h"

int main(int argc, char *argv[])
{
    QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);

    QApplication a(argc, argv);
    a.setApplicationName("z-tools-toolbox");

#ifndef ZTBOX_TEST_PLUGINS
    a.setApplicationDisplayName("迷你工具箱 - v" PROJECT_VERSION);
#endif

    MainWindow wm;
    wm.show();
   
    ScreenUtil::moveCenterMiddleUp(wm);

#ifdef ZTBOX_TEST_PLUGINS
    QString filePath = ZTBOX_TEST_PLUGINS;
    emit ZTBoxPluginLoader::instance().pluginSwitchSignal(filePath);
#else
    // 对可能传入的 so 文件路径进行操作
    if (argc > 1) {
        emit ZTBoxPluginLoader::instance().pluginSwitchSignal(argv[1]);
    }
#endif
    return a.exec();
}
